<template>
 <div>
  <!-- 返回首页 -->
  <uni-bankhome />
  <view class="publicity-box">
   <view class="nodata" v-if="info==''">
    <image src="@/static/nodata.png"></image>
   </view>
   <view v-else>
    <view class="title">{{info.name}}</view>
    <view class="issuer">
     <div>发布人：{{info.nickName||''}} {{info.createTime||''}}</div>
    </view>
    <view class="image-wrapper">
     <image style="width:100%;vertical-align: top;" :src="info.posterUrl" mode="aspectFill"></image>
    </view>
    <view class='content'>
     <rich-text :nodes="info.content"></rich-text>
    </view>
   </view>
   <uni-load-more :status="loadingType"></uni-load-more>
  </view>
 </div>
</template>

<script>
 import {
  publicityInfo
 } from "@/api/home.js"
 export default {
  data() {
   return {
    info: '',
    loadingType: "more", //加载更多状态
   }
  },
  onLoad(val) {
   this.getPublicityInfo(val.id)
  },
  methods: {
   getPublicityInfo(id) {
    publicityInfo(id).then(res => {
     if (res.data.success && res.data.result) {
      this.info = res.data.result
      this.info.content=this.info.content.replace(/\<img/gi,'<img style="width:100% ;height:auto;diaplay:block;"')
      this.loadingType = "noMore"
     } else {
      this.info = ''
      this.loadingType = "noMore"
     }
    })
   }
  }
 };
</script>

<style lang="scss" scoped>
 .publicity-box {
  height: 100vh;
  padding-top: 42upx;

  .title {
   font-size: 40upx;
   font-weight: 700;
   color: rgba(36, 36, 36, 1);
   margin-left: 20upx;
  }

  .issuer {
   font-size: 26upx;
   color: rgba(87, 87, 87, 1);
   margin: 20upx 0 20upx 20upx;
  }

  .content {
   font-size: 28upx;
   // background-color: greenyellow;
   color: rgba(115, 115, 115, 1);
   padding: 30upx;
  }
 }
</style>